<?php


namespace app\api\controller\xiluedu;


use app\common\controller\Api;
use app\common\model\xiluedu\Banner AS BannerModel;

class Banner extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    /**
     * @ApiTitle    (轮播图列表)
     * @ApiMethod   (GET)
     * @ApiRoute    (/api/xiluedu.banner/banners/group/{group})
     * @ApiParams   (name="group", type="string", required=true, description="位置")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturnParams   (name="data", type="object", sample="{'id':'int','image':'string','url':'string'}", description="轮播数据")
     */
    public function banners() {
        $group = $this->request->param('group');
        $banners = BannerModel::getBanners($group, true);
        $this->success('查询成功',$banners);
    }

}